﻿using Athena.Performance.Models.Arguments;
using Athena.Performance.Models.MQ;
using MassTransit;
using System;

namespace Athena.Performance.Compare
{
    [RabbitMqUri(VirtualHost = "sandbox", Queue = "test_compare")]
    public class UserLoginRequest: BaseRequest,IUserLoginRequest
    {
        public UserLoginRequest(Guid? guid) : base(guid)
        {

        }
        public string UserName { get; set; }

        public string Password { get; set; }

        private static IRequestClient<IUserLoginRequest, IUserLoginResponse> _requestClient;

        public static IRequestClient<IUserLoginRequest, IUserLoginResponse> Client
        {
            get
            {
                return _requestClient;
            }
        }

        public override void CreateClient(IBusControl busControl, Uri address)
        {
            _requestClient = busControl.CreateRequestClient<IUserLoginRequest, IUserLoginResponse>(address, TimeSpan.FromSeconds(10));
        }
    }
}
